package com.sc.nft.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.sc.nft.enums.OrderStatusEnum;
import com.sc.nft.enums.TradingPoolTransactionTypeEnum;
import com.sc.nft.sup.SuperEntity;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 生态池订单表
 *
 * @TableName sc_trading_pool_order
 */
@TableName(value = "sc_trading_pool_order")
@Data
public class TradingPoolOrder extends SuperEntity<TradingPoolOrder> implements Serializable {

    private static final long serialVersionUID = -6892701757848448980L;
    /**
     * 生态池配置 ID
     */
    @TableField(value = "trading_pool_config_id")
    private Long tradingPoolConfigId;

    /**
     * daoId
     */
    @TableField(value = "dao_id")
    private Long daoId;

    /**
     * 藏品 ID
     */
    @TableField(value = "collection_id")
    private Long collectionId;

    /**
     * 用户藏品 ID
     */
    @TableField(value = "user_collection_id")
    private Long userCollectionId;

    /**
     * 用户 ID
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 价格
     */
    @TableField(value = "price")
    private BigDecimal price;

    /**
     * 价格(红包支付)
     */
    @TableField(value = "pay_balance_price")
    private BigDecimal payBalancePrice;

    /**
     * 手续费
     */
    @TableField(value = "charge")
    private BigDecimal charge;

    /**
     * 上链费
     */
    @TableField(value = "gas")
    private BigDecimal gas;

    /**
     * 状态
     */
    @TableField(value = "status")
    private OrderStatusEnum status;

    /**
     * 订单号
     */
    @TableField(value = "order_no")
    private String orderNo;

    /**
     * 编号
     */
    @TableField(value = "numbering")
    private Integer numbering;

    /**
     * 交易时间
     */
    @TableField(value = "deal_time")
    private Date dealTime;

    /**
     * 支付时间
     */
    @TableField(value = "pay_time")
    private Date payTime;

    /**
     * 关闭时间
     */
    @TableField(value = "close_time")
    private Date closeTime;

    /**
     * 实际关闭时间
     */
    @TableField(value = "real_close_time")
    private Date realCloseTime;

    /**
     * 实际到账金额
     */
    @TableField(value = "real_amount")
    private BigDecimal realAmount;

    /**
     * 最大涨幅百分比
     */
    @TableField(value = "max_increase_percentage")
    private BigDecimal maxIncreasePercentage;

    /**
     * 最大跌幅百分比
     */
    @TableField(value = "max_decrease_percentage")
    private BigDecimal maxDecreasePercentage;

    /**
     * 当前价格-前端传入的价格.和最大涨跌幅进行对比,用来查账
     */
    @TableField(value = "present_price")
    private BigDecimal presentPrice;

    /**
     * 分润模版id
     */
    @TableField(value = "share_profit_panel_id")
    private Long shareProfitPanelId;

    /**
     * 交易类型，0：买，1：卖  以用户维度出发
     */
    @TableField(value = "transaction_type")
    private TradingPoolTransactionTypeEnum transactionType;

    /**
     * 结算标记，0：未结算，1：已结算
     */
    @TableField(value = "settlement_flag")
    private Boolean settlementFlag;

    /**
     * 分润结算标记
     */
    @TableField(value = "share_settle_flag")
    private Boolean shareSettleFlag;

    /**
     * 乐观锁版本号
     */
    @Version
    private Integer version;

}